<template>
	<view id="app" @click="openMsg">
		<!-- 商家中心 -->
		<view class="shopcenter bffae65 plr30 cw">
			<!-- 信息 -->
			<view class="rows pt30">
				<!-- 个人信息 -->
				<view class="f1 df aic">
					<view class="avatar wh100">
						<image :src="wrap.shop_logo" mode="aspectFill"></image>
					</view>
					<view class="wdmaintr ml20">
						<view class="f34 df aic pb10 thd">{{wrap.shop_name}}</view>
						<view class="df dfsb aic w100p">
							<view class="f28">{{wrap.shop_mobile}}</view>
						</view>
					</view>
				</view>
				

				<!-- 个人资料 -->
				<navigator hover-class="none" url="/pages/my/shop/shop" class="df aic f30">
					<text>商家资料</text>
					<uni-icons type="arrowright" color="#fff"></uni-icons>
				</navigator>
			</view>
		</view>

		<!-- 个人中心区 -->
		<view class="money area rows mlr30 ptb20 plr40 c333">
			<navigator hover-class="none" url="/pages/my/shop/money" class="col f1">
				<view class="f28">可提现金额</view>
				<view class="mt20 thd f44 fwb">￥{{wrap.balance ? wrap.balance : '0'}}</view>
			</navigator>
			<navigator hover-class="none" url="/pages/my/shop/money" class="col f1">
				<view class="f28">冻结金额</view>
				<view class="mt20 thd f44 fwb">￥{{wrap.balance_cold ? wrap.balance_cold : '0'}}</view>
			</navigator>
		</view>

		<!-- 订单管理 -->
		<view class="mOrder area mt30 mlr30 plr30">
			<!-- 标题 -->
			<navigator hover-class="none" class="title rows ptb20 bdb1sE"
				:url="'/pages/my/shop/order?type=1&id=' + wrap.id">
				<view class="txt c333 f30">订单管理</view>
				<view class="icon">
					<uni-icons type="arrowright" color="#404e60"></uni-icons>
				</view>
			</navigator>
			<!-- 内容 -->
			<view class="wrap df dfsa aic pt50 ptb30 f26">
				<!-- 全部订单 -->
				<navigator hover-class="none" :url="'/pages/my/shop/order?type=1&selluser=' + wrap.id"
					class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/order1.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">全部订单</view>
				</navigator>

				<!-- 待付款 -->
				<navigator hover-class="none" :url="'/pages/my/shop/order?type=2&selluser=' + wrap.id"
					class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/order2.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">待付款</view>
				</navigator>

				<!-- 待发货 -->
				<navigator hover-class="none" :url="'/pages/my/shop/order?type=3&selluser=' + wrap.id"
					class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/order3.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">待发货</view>
				</navigator>

				<!-- 已完成 -->
				<navigator hover-class="none" :url="'/pages/my/shop/order?type=4&selluser=' + wrap.id"
					class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/order4.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">已完成</view>
				</navigator>

				<!-- 退款售后 -->
				<navigator hover-class="none" :url="'/pages/my/shop/order?type=5&selluser=' + wrap.id"
					class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/order5.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">退款售后</view>
				</navigator>
			</view>
		</view>

		<!-- 商品管理 -->
		<view class="mOrder area mt30 mlr30 plr30">
			<!-- 标题 -->
			<navigator hover-class="none" url="/pages/my/shop/product" class="title rows ptb20 bdb1sE">
				<view class="txt c333 f30">商品管理</view>
				<view class="icon">
					<uni-icons type="arrowright" color="#404e60"></uni-icons>
				</view>
			</navigator>
			<!-- 内容 -->
			<view class="wrap df dfsa aic pt50 ptb30 f26">
				<!-- 全部 -->
				<navigator hover-class="none" url="/pages/my/shop/product?type=1" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/pro1.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">全部</view>
				</navigator>

				<!-- 待审核 -->
				<navigator hover-class="none" url="/pages/my/shop/product?type=2" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/pro2.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">待审核</view>
				</navigator>

				<!-- 上架中 -->
				<navigator hover-class="none" url="/pages/my/shop/product?type=3" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/pro3.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">上架中</view>
				</navigator>

				<!-- 已下架 -->
				<navigator hover-class="none" url="/pages/my/shop/product?type=4" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/pro4.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">已下架</view>
				</navigator>

			</view>
		</view>

		<!-- 推销管理 -->
		<view class="mOrder area mt30 mlr30 plr30">

			<!-- 标题 -->
			<view class="title rows ptb20 bdb1sE">
				<view class="txt c333 f30">推销管理</view>
				<view class="icon">
					<uni-icons type="arrowright" color="#404e60"></uni-icons>
				</view>
			</view>

			<!-- 内容 -->
			<view class="wrap df dfsa aic pt50 ptb30 f26">
				<!-- 全部 -->
				<navigator hover-class="none" url="/pages/my/shop/tuipro?type=1" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/tui1.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">全部</view>
				</navigator>

				<!-- 待处理 -->
				<navigator hover-class="none" url="/pages/my/shop/tuipro?type=2" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/tui2.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">待处理</view>
				</navigator>

				<!-- 待合作 -->
				<navigator hover-class="none" url="/pages/my/shop/tuipro?type=3" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/tui3.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">待合作</view>
				</navigator>

				<!-- 合作中 -->
				<navigator hover-class="none" url="/pages/my/shop/tuipro?type=4" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/tui4.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">合作中</view>
				</navigator>

				<!-- 已结束 -->
				<navigator hover-class="none" url="/pages/my/shop/tuipro?type=5" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/tui5.png" mode="aspectFit"></image>
					</view>
					<view class="txt mt10">已结束</view>
				</navigator>
			</view>

			<!-- 推销员管理 -->
			<navigator hover-class="none" url="/pages/my/shop/tuipeo" class="title rows ptb20 bdt1sE">
				<view class="txt c333 f30">推销员管理</view>
				<view class="icon">
					<uni-icons type="arrowright" color="#404e60"></uni-icons>
				</view>
			</navigator>
		</view>


	</view>
</template>
<script>
	// 设置页面变量
	var that;
	export default {
		// 页面变量
		data() {
			return {
				// 内容
				wrap: {},
			}
		},

		// 获取后
		onLoad() {
			that = this;

			// 获取通用信息
			// that.getnews();
		},

		// 显示后
		onShow() {
			// 获取个人信息
			that.getinfo();
		},

		// 方法列表
		methods: {
			openMsg() {
				wx.requestSubscribeMessage({ // 调起消息订阅界面
					tmplIds: [
						'dNvjJOkcLYsmM2KXDTwYsoU7WVIxu6efNzyjzZmSyf4',
						'xhoD5I9OB1TOKKbbdXoscpkkaoaoKgDahRlsiu9RJl4'
					],
					success(res) {
						console.log('订阅消息 成功 ');
						console.log(res);
					},
					fail(er) {
						console.log("订阅消息 失败 ");
						console.log(er);
					}
				})
			},
			// 获取个人信息
			getinfo() {
				// 获取个人信息
				that.util.getuserinfo((rs) => {
					// 赋值内容
					that.wrap = rs.data.userinfo;
				});
			},

			// 获取通用信息
			getnews() {
				that.request({
					url: '/api/user/getnews',
					success(rs) {
						if (rs.code == 1) {
							that.guokao_url = rs.data.guokao_url;
						}
					}
				});
			},

			// 个人资料 接口
			userinfo() {
				that.request({
					load: true,
					url: '/api/user/userinfo',
					data: {
						token: uni.getStorageSync('token'),
					},
					success(rs) {
						// console.log('获取资料',rs.data.money);
						if (rs.code == 1) {
							that.info = rs.data;
						}
					}
				});
			},

			// 我的资料
			data() {
				uni.navigateTo({
					url: '/pages/my/data',
				});
			},

			// 账户余额
			money() {
				uni.navigateTo({
					url: '/pages/my/money',
				})
			},

			// 1 发布 2 商家中心
			core(e) {
				if (e == 1) {
					uni.navigateTo({
						url: '/pages/my/product',
					})
					return
				}
				if (e == 2) {
					uni.navigateTo({
						url: '/pages/my/core',
					})
					return
				}
			},

			navli(e) {
				// 在线客服
				if (e == 1) {
					uni.navigateTo({
						url: '/pages/my/service',
					})
					return
				}
				// 平台公告
				if (e == 2) {
					uni.navigateTo({
						url: '/pages/my/Notice',
					})
					return
				}
				// 关于平台
				if (e == 3) {
					uni.navigateTo({
						url: '/pages/my/Noticedatails?title=' + '关于平台',
					})
					return
				}
			},

			//login
			login() {
				uni.navigateTo({
					url: '../login/login',
				});
			},

		},

	}
</script>
<style lang="less">
	/* 顶部 */
	.shopcenter {
		height: 250rpx;
		border-radius: 0 0 50% 50% ~'/'0 0 20rpx 20rpx;

		// 头像
		.avatar {
			padding: 5rpx;
			background-color: white;
		}
	}

	// 金额
	.money {
		margin-top: -60rpx;
		background: url(/static/clip.png) no-repeat right bottom #fff;
		background-size: 150rpx 120rpx;
	}
</style>
